package com.niit.house.lyl.ownership;


import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class OwnershipMapper extends Mapper<Object, Text, Text, Text> {

    @Override
    protected void map(Object key, Text value, Context context) throws IOException, InterruptedException {
        String[] record = value.toString().split(",");
        try {
            String ownership = record[13]; // 交易权属态在第13个字段

            context.write(new Text(ownership), new Text(""));
        } catch (NumberFormatException | ArrayIndexOutOfBoundsException | NullPointerException e) {
            // 忽略解析失败的数据行
        }
    }
}
